<template>
    <view>
        <view class="grey" v-if="deviceSelectShow"></view>
        <view class="navTitle">
            <view>当前设备</view>
        </view>
        <view class="navs">
            <view class="nav">
                <view class="text" @click="showDeviceSelect">
                    {{storeList[storeIndex].deviceList[deviceIndex].id || '未绑定任何设备'}}</view>
                <image src="/static/icons/right.png"></image>
                <view class="select" v-if="deviceSelectShow">
                    <view class="radio" @click="deviceSelect(index)"
                        v-for="(item,index) in storeList[storeIndex].deviceList">{{item.id}}</view>
                </view>
            </view>
        </view>
        <view class="lists">
            <view class="title">
                <view class="name">商品名称</view>
                <view class="count">当前库存</view>
                <view class="count">标准库存</view>
                <view class="count">待补货</view>
                <view class="count">已售数量</view>
            </view>
            <block v-for="(item, index) in stockList">
                <view class="list">
                    <view class="name">{{item.name}}</view>
                    <view class="count">{{item.count}}</view>
                    <view class="count">{{item.baseCount}}</view>
                    <view class="count">{{item.baseCount - item.count}}</view>
                    <view class="count">{{item.sell}}</view>
                </view>
            </block>

        </view>
        <view class="noMore" v-if='noMore || !stockList.length'>没有更多啦</view>
        <view class="footer">
            <view class="contents">
                <view class="nav" @click="home">
                    <image src="/static/icons/home.png"></image>
                    <view>首页</view>
                </view>
                <view class="nav">
                    <image src="/static/icons/stock2.png"></image>
                    <view style="color: #FFD700;">上货库存</view>
                </view>
                <view class="nav" @click="record">
                    <image src="/static/icons/record.png"></image>
                    <view>上货记录</view>
                </view>
                <view class="nav" @click="personal">
                    <image src="/static/icons/personal.png"></image>
                    <view>个人中心</view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
    import stock from "./stock.js";
    export default stock;
</script>

<style>
    @import url("./stock.css");
</style>